﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Management/ChargeNurse/ChargeNurse.master"
    AutoEventWireup="true" CodeFile="WaitingList.aspx.cs" Inherits="Management_ChargeNurse_WaitingList" %>

<%@ Register Src="../Room.ascx" TagName="Room" TagPrefix="uc1" %>
<%@ Register Src="../Bed.ascx" TagName="Bed" TagPrefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<style type="text/css">
        .tbHeader
        {
            vertical-align: middle;
            text-align: left;
            border: 1px;
            height: 40px;
        }
        .tbCell
        {
            vertical-align: middle;
            text-align: left;
            height: 30px;
            border: 1px;
        }       
    </style>
    <asp:Panel ID="Panel1" runat="server" Height="181px" Width="100%">
        <table width="100%" style="vertical-align:top" cellpadding="10" cellspacing="10">
            <tr>
                <td style="width: 351px">
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
                        DataSourceID="benhnhanDS" ShowHeaderWhenEmpty="true" Width="331px" CellPadding="4" 
                        ForeColor="#333333" GridLines="None">
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        <Columns>
                            <asp:TemplateField HeaderText="Tên bệnh nhân">
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("FirstName")+" "+Eval("LastName")  %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="tbCell" />
                                <HeaderStyle CssClass="tbHeader" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:LinkButton ID="Label2" runat="server" Text="Chọn giường" OnClick="benhnhan_click"
                                        CommandArgument='<%# Eval("IDPatient") %>'></asp:LinkButton>
                                </ItemTemplate>
                                <ItemStyle CssClass="tbCell" />
                                <HeaderStyle CssClass="tbHeader" />
                            </asp:TemplateField>
                        </Columns>
                        <EditRowStyle BackColor="#999999" />
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#E9E7E2" />
                        <SortedAscendingHeaderStyle BackColor="#506C8C" />
                        <SortedDescendingCellStyle BackColor="#FFFDF8" />
                        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="benhnhanDS" runat="server" ConnectionString="<%$ ConnectionStrings:HOSPITALMANAGEMENTConnectionString %>"
                        SelectCommand="SELECT IDPatient, FirstName, LastName, DOB FROM [tbImpatient] INNER JOIN tbPatient ON tbImpatient.[IDPatient]=tbPatient.[ID] WHERE [IDBed] = 0 AND IDWard=@IDWard ORDER BY DateInWard ASC">
                        <SelectParameters>
                            <asp:FormParameter Name="IDWard" FormField="IDWard" Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
                <td>
                    <asp:Panel runat="server" ID="pnRoom" Visible="false">
                        <table width="100%">
                            <tr>
                                <td style="width: 89px">
                                    <asp:Label ID="Label3" runat="server" Text="Chọn phòng"></asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="liRoom" runat="server" Height="40px" Width="184px" AutoPostBack="true"
                                        OnSelectedIndexChanged="room_changed">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 89px">
                                    <asp:Label ID="Label4" runat="server" Text="Chọn giường"></asp:Label>
                                </td>
                                <td>
                                    <uc2:Bed ID="Bed1" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                <br />
                                    <asp:Button ID="btSetBed" runat="server" Text="Đặt giường" 
                                        onclick="btSetBed_Click" />
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
